import { Table } from 'antd';
import React from 'react';
import styles from './index.less';

const columns = [
  { title: '序号', dataIndex: 'key', key: 'key', width: 100 },
  { title: '电厂名称', dataIndex: 'name', key: 'name' },
  { title: '指标', dataIndex: 'point', key: 'point' },
  { title: '级别', dataIndex: 'level', key: 'level' },
  { title: '告警时间', dataIndex: 'time', key: 'time' },
];

const tableData = [
  {
    key: 1,
    name: '连云港电厂',
    point: '污水',
    level: '三级',
    time: '2022/3/7 13:01',
  },
  {
    key: 2,
    name: '连云港电厂',
    point: '污水',
    level: '三级',
    time: '2022/3/7 13:01',
  },
  {
    key: 3,
    name: '连云港电厂',
    point: '污水',
    level: '三级',
    time: '2022/3/7 13:01',
  },
  {
    key: 4,
    name: '连云港电厂',
    point: '污水',
    level: '三级',
    time: '2022/3/7 13:01',
  },
  {
    key: 5,
    name: '连云港电厂',
    point: '污水',
    level: '三级',
    time: '2022/3/7 13:01',
  },
  {
    key: 6,
    name: '连云港电厂',
    point: '污水',
    level: '三级',
    time: '2022/3/7 13:01',
  },
  {
    key: 7,
    name: '连云港电厂',
    point: '污水',
    level: '三级',
    time: '2022/3/7 13:01',
  },
];

export default function FirstTable(props) {
  const { height } = props;
  const newHeight = height - 120;

  return (
    <div className={styles.root}>
      <Table
        columns={columns}
        dataSource={tableData}
        scroll={{ x: '100%', y: newHeight }}
        pagination={false}
      />
    </div>
  );
}
